package ui;
import java.util.List;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Composite;

import each_class.SongClass;

public class SearchUI extends AbstractUI {

	private MusicView musicView;
	public SearchUI(Composite parent, int style) {
		super(parent, style);
		tabFolder.setBounds(25, 75, 1185, 42);
		title.setLocation(35, 18);
		title.setText("搜索结果");
		setBounds(70, 52, 1210, 636);
		
		musicView = new MusicView(this, SWT.NONE);
		musicView.setBounds(0, 123, 1210, 513);
		TabFolderItem musicItem =  new TabFolderItem(tabFolder, musicView);
		TabFolderItem musicListItem =  new TabFolderItem(tabFolder, null);
		tabFolder.setFont(new Font(getDisplay(), "Microsoft YaHei UI", 18, SWT.NORMAL));
		musicItem.setText("歌曲");
		musicListItem.setText("歌单");
		tabFolder.setCurrentTabFolderItem(musicItem);
		tabFolder.getCurrentTabFolderItem().active();
		tabFolder.layout();

	}

	public void initail(List<SongClass> musicList) {
		musicView.dispose();
		musicView = new MusicView(this, SWT.NONE);
		musicView.setBounds(0, 123, 1210, 513);
		musicView.loadMusic(musicList);
	}

	@Override
	protected void loadingAnimation() {
	}
	
	@Override
	public void active() {
		setVisible(true);
	}
}
